home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / ImageMaster_d1.adf / install-im < prev    next >
Text File  |  1993-04-15  |  20KB  |  537 lines

  1. ; CBM installer script to install Imagemaster on users hard-drive
  2. ;          by: Ben Williams
  3. ;     Written: Aug 26/92
  4. ; --------------------------------------------------------------
  5. ;     Updates: Apr 15/93 - extract moved to disk 1 and self-compressed
  6. ;              Mar 17/93 - new split piarc.lzh handling
  7. ;              Oct  5/92 - dctv.library added to distribution to read dctv pix
  8. ;              Sep 30/92 - Adds "wipes" dir to RXPI: for transition generator
  9. ;                        - Fixes doc & dev installs so they work better
  10. ;                        - Removes "takes time req", substitutes CON: windows
  11. ;              Sep 24/92 - Extract now OVER-writes; RE-installs work ok now
  12. ;              Aug 31/92 - Non-prompting assignment checks added
  13. ;----------------------------------------------------------------
  14. ;Notes:
  15. ;------->
  16. ;  (1) We force a minimum level of AVERAGE user so that they
  17. ;      must specify the target directory for the install and
  18. ;      answer some basic questions such as "Do you have an FPU"
  19. ;
  20. ;  (2) There must be sufficient diskspace to install the software
  21. ;      or we won't even try to install.
  22. ;
  23. ;  (3) ARexx must be available, or we won't try to install
  24. ;----------------------------------------------------------------
  25.  
  26. ; cleanup routine
  27. ;----------------
  28. (onerror)
  29.  
  30. ; Make certain rexx: directory exists - if ARexx isn't running, we
  31. ; can (sortof) live with that, though the user will be seriously
  32. ; crippled in capability. If no assignment exists, we're toast
  33. ;-----------------------------------------------------------------
  34. (if (= (getassign "rexx") "")
  35.     (abort "Cannot install - no REXX: assignment in this system. "
  36.            "You MUST have ARexx and a drawer assigned to REXX: "
  37.            "to hold ARexx scripts in order to successfully "
  38.            "install Imagemaster. Please properly configure "
  39.            "your computer and try again. If you do not know how "
  40.            "to accomplish this, call your dealer or consultant."
  41.     )
  42. )
  43.  
  44. ; Find out where user wants to put Imageaster
  45. ;----------------------------------------------
  46. (set user_place
  47.     (askdir
  48.         (prompt "Where shall we place the Imagemaster DRAWER? ")
  49.         (help @askdir-help "It is important that you realize that the destination you specify here "
  50.                            "is for the DRAWER in which Imagemaster and it's associated data files "
  51.                            "will be placed. Even if this is an update to an earlier installation, "
  52.                            "you still need to specify this location the same way. Otherwise, a new "
  53.                            "\"Imagemaster\" drawer will be created INSIDE your old one, causing "
  54.                            "much confusion and not amusing anyone.")
  55.         (default @default-dest)
  56.     )
  57. )
  58.  
  59. ; Check to see if assigns are already made
  60. ;-----------------------------------------
  61. (set as_made 0)
  62. (if (<> (getassign "rxpi:") "")
  63.     (if (<> (getassign "cmpi:") "")
  64.         (set as_made 1)
  65.     )
  66. )
  67.  
  68. ; Find out if user wants the developer code
  69. ;------------------------------------------
  70. (set dev_install
  71.     (askoptions
  72.         (prompt "Would you like to have the Public Interface developer "
  73.                 "C and ARexx code, with documentation? This will allow "
  74.                 "you to create public interface modules of your own, if "
  75.                 "you own the SAS C compiler and have typical Amiga "
  76.                 "developer skills.")
  77.                 (help @askoptions-help "If you are NOT a technical type, "
  78.                 "you have no need for this data. If you are, then by all "
  79.                 "means install it!")
  80.         (choices "Install SAS C and ARexx developer code?")
  81.         (default 0)
  82.     )
  83. )
  84.  
  85. ; Check with user if they want the docs on-disk
  86. ;----------------------------------------------
  87. (set doc_install
  88.     (askoptions
  89.         (prompt "Would you like to install the additional documents "
  90.                 "into the Imagemaster drawer? This is not usually "
  91.                 "necessary, because they can be printed by clicking "
  92.                 "on the \"print-docs\" icon at any time, if you have "
  93.                 "a printer.")
  94.         (help "If you do NOT have a printer, you'll have to read the "
  95.               " documents using a text editor, and you SHOULD install "
  96.               "them to the Imagemaster drawer. "
  97.               @askoptions-help)
  98.         (choices "Install addendum into Imagemaster drawer?")
  99.         (default 0)
  100.     )
  101. )
  102.  
  103. ; Check with user if they want the floating point version
  104. ;--------------------------------------------------------
  105. (set float_install
  106.     (askchoice
  107.         (prompt "Do you have a floating-point unit (FPU)? ")
  108.         (help "An FPU is a special hardware mathematics processor "
  109.               "which allows a computer which uses it to figure out "
  110.               "answers to math problems using floating point math "
  111.               "much faster than it could without an FPU. A 68000 "
  112.               "Amiga has no FPU. 68020 or 68030 based-Amigas may "
  113.               "have an FPU - check your documentation if you're not "
  114.               "certain. 68040-based Amigas always have the FPU built "
  115.               "right in. The non-FPU version will work on an Amiga "
  116.               "with an FPU, however it will be much slower which "
  117.               "will cost you unecessary time when processing images. "
  118.               @askchoice-help)
  119.         (choices "Install Floating Point (FPU) version"
  120.                  "Install standard (NON-FPU) version")
  121.         (default 1)
  122.     )
  123. )
  124.  
  125. ; We know where Imagemaster is to be installed now, we'll do some
  126. ; checking to make sure that we have enough room for the installation.
  127. ; The IM release is (approximately) sized as follows:
  128. ;---------------------------------------------
  129. ; Imagemaster ------------------- 1400000 bytes
  130. ; FilmView ----------------------   45000 bytes
  131. ; IShapes -----------------------   21000 bytes
  132. ; Addendum file -----------------  190000 bytes
  133. ; Developer stuff ---------------   16000 bytes
  134. ; Public Interface Modules ------ 1300000 bytes
  135. ;                                 -------
  136. ;                       Total:    2972000 bytes - about 3 megabytes
  137. ;-----------------------------------------------------------------------
  138. (set tgt_space  (getdiskspace user_place))
  139. (set total_size 3000000)
  140. (if (= dev_install 0)
  141.     (set total_size (- total_size "16000"))
  142. )
  143. (if (= doc_install 0)
  144.     (set total_size (- total_size "190000"))
  145. )
  146.  
  147. ; If we can't do the main install, quit immediately
  148. ;
  149. (if (< tgt_space total_size)
  150.     (abort "This installation requires about " ("%ld" total_size)
  151.            " bytes free on the "
  152.            "volume where you wish to install Imagemaster. Please "
  153.            "make this space available and then re-install. For your "
  154.            "information, the volume you have selected has only "
  155.            ("%ld " tgt_space) "bytes free. You need "
  156.            ("%ld " (- total_size tgt_space)) "more bytes.")
  157. )
  158.  
  159. ; We'll need our compressed-file extraction command:
  160. ;---------------------------------------------------
  161. (set src_disk "IM_Install1:")
  162. (askdisk
  163.     (prompt "Please insert Imagemaster diskette #1")
  164.     (help "We need to copy some files from this diskette.")
  165.     (dest "IM_Install1")
  166. )
  167.  
  168. ; Get the extract command
  169. ;------------------------
  170. (copyfiles (source src_disk)
  171.            (dest "ram:")
  172.            (pattern "extract")
  173.            (files)
  174. )
  175.  
  176. ; Now we'll get a grip on our installation volume
  177. ;------------------------------------------------
  178.  
  179. (set src_one "IM_Install1")
  180. (set src_two "IM_Install2")
  181. (set src_three "IM_Install3")
  182. (set src_four "IM_Install4")
  183. ; We've got the target; now we need to make sure that we have our main DIR
  184. ;-------------------------------------------------------------------------
  185. (
  186.     (set im_dest (tackon user_place "Imagemaster"))
  187.     (if (not (exists im_dest))
  188.         (makedir im_dest (infos))
  189.     )
  190.     (set @default-dest im_dest)
  191. )
  192.  
  193. ; Create subordinate target strings
  194. ;----------------------------------
  195. (set rxpi_dir (tackon im_dest "rxpi"))
  196. (set wipe_dir (tackon rxpi_dir "wipes"))
  197. (set cmpi_dir (tackon im_dest "cmpi"))
  198. (set ish_dir  (tackon im_dest "IShapes"))
  199. (set dev_dir  (tackon im_dest "Developer"))
  200. (set doc_dir  (tackon im_dest "Docs"))
  201. (set lib_dir  "libs:")
  202. (set rexx_dir "rexx:")
  203.  
  204. ; Create RXPI drawer if it's not already there
  205. ;---------------------------------------------
  206. (if (not (exists rxpi_dir))
  207.     (makedir rxpi_dir (infos))
  208. )
  209.  
  210. ; Create wipes drawer if it's not already there
  211. ;----------------------------------------------
  212. (if (not (exists wipe_dir))
  213.     (makedir wipe_dir (infos))
  214. )
  215.  
  216. ; Create CMPI drawer if it's not already there
  217. ;---------------------------------------------
  218. (if (not (exists cmpi_dir))
  219.     (makedir cmpi_dir (infos))
  220. )
  221.  
  222. ; Create IShapes drawer if it's not already there
  223. ;------------------------------------------------
  224. (if (not (exists ish_dir))
  225.     (makedir ish_dir (infos))
  226. )
  227.  
  228. ; make assignments so user can operate immediately
  229. ;-------------------------------------------------
  230. (makeassign "RXPI" rxpi_dir (safe))
  231. (makeassign "CMPI" cmpi_dir (safe))
  232.  
  233. ; Check to see if user has old rxpi and cmpi installation
  234. ; If so, copy those files to the new location in case they
  235. ; have any aftermarket or custom PI modules in there...
  236. ;--------------------------------------------------------
  237. (if (exists "rexx:rxpi")
  238.     (
  239.         (set as_made 0) ; because we are in a new location!
  240.         (copyfiles (source "rexx:rxpi") (dest "rxpi:")
  241.                    (pattern "#?") (files))
  242.         (run "delete rexx:rxpi/#? QUIET")
  243.         (run "delete rexx:rxpi QUIET")
  244.     )
  245. )
  246.  
  247. (if (exists "c:cmpi")
  248.     (
  249.         (set as_made 0) ; because we are in a new location!
  250.         (copyfiles (source "c:cmpi") (dest "cmpi:")
  251.                    (pattern "#?") (files))
  252.         (run "delete rexx:cmpi/#? QUIET")
  253.         (run "delete rexx:cmpi QUIET")
  254.     )
  255. )
  256.  
  257. ; copy things we KNOW we need
  258. ;----------------------------
  259. (set imp_src src_two)
  260. (askdisk
  261.     (prompt ("Please insert the %s diskette " imp_src))
  262.     (help "This diskette is absolutely required to complete this "
  263.           "installation!")
  264.     (dest imp_src)
  265. )
  266. (copyfiles (source (cat imp_src ":"))
  267.            (dest "ram:")
  268.            (pattern "(ish.lzh|fv.lzh|imi.lzh)")
  269.            (files)
  270. )
  271.  
  272. ; Extract this portion of the installation
  273. ;-----------------------------------------
  274. (run ("ram:extract >con:0/50/640/100/extract -m e ram:imi %s/" im_dest))
  275. (run ("ram:extract >con:0/50/640/100/extract -m e ram:fv %s/" im_dest))
  276. (run ("ram:extract >con:0/50/640/100/extract -m e ram:ish %s/" ish_dir))
  277.  
  278. ; Decide about .info file name
  279. ;-----------------------------
  280. (if (= float_install 0)
  281.     (rename (tackon im_dest "iminfo") (tackon im_dest "imf.info")) ; then
  282.     (rename (tackon im_dest "iminfo") (tackon im_dest "im.info")) ; else
  283. )
  284.  
  285. ; Clean up after these archives
  286. ;------------------------------
  287. (delete "ram:ish.lzh")
  288. (delete "ram:fv.lzh")
  289. (delete "ram:imi.lzh")
  290.  
  291. ; Now, we'll extract the main image processor after figuring out which ver
  292. ;-------------------------------------------------------------------------
  293. (set imp_src src_two)
  294. (set proc_file "ima.lzh")
  295. (if (= float_install 0)
  296.     (
  297.         (set imp_src src_one)
  298.         (set proc_file "imb.lzh")
  299.     )
  300. )
  301.  
  302. ; Ask for the proper diskette
  303. ;----------------------------
  304. (askdisk
  305.     (prompt ("Please insert the %s diskette " imp_src))
  306.     (help "This diskette is absolutely required to complete this "
  307.           "installation!")
  308.     (dest imp_src)
  309. )
  310.  
  311. ; This gets the needed archive from the proper disk
  312. ;--------------------------------------------------
  313. (copyfiles (source (cat imp_src ":"))
  314.            (dest "ram:")
  315.            (pattern proc_file)
  316.            (files)
  317. )
  318.  
  319. ; Here, we extract the image processor, copying it at the same time
  320. ;------------------------------------------------------------------
  321. (run ("ram:extract >con:0/50/640/100/extract -m e ram:%s %s/" proc_file im_dest))
  322.  
  323. ; Delete the image processor archive
  324. ;-----------------------------------
  325. (delete ("ram:%s" proc_file))
  326.  
  327. ; Now we'll go after the two optional installs and the PI modules
  328. ;----------------------------------------------------------------
  329. (set imp_src src_three)
  330. (askdisk
  331.     (prompt ("Please insert the %s diskette " imp_src))
  332.     (help "This diskette is absolutely required to complete this "
  333.           "installation!")
  334.     (dest imp_src)
  335. )
  336.  
  337. ; If user wants the developer stuff, install it
  338. ;----------------------------------------------
  339. (if (= dev_install 1)
  340.     (
  341.         (if (not (exists dev_dir))
  342.             (makedir dev_dir (infos))
  343.         )
  344.         (copyfiles (source (cat imp_src ":"))
  345.                    (dest "ram:")
  346.                    (pattern "dd.lzh")
  347.                    (files))
  348.         (run ("ram:extract >con:0/50/640/100/extract -m e ram:dd %s/" dev_dir))
  349.         (delete "ram:dd.lzh")
  350.     )
  351. )
  352.  
  353. ; Get the archive....
  354. ;----------------------------------------------------
  355. (makedir "ram:gbzyx")
  356. (copyfiles (source (cat imp_src ":"))
  357.            (dest "ram:")
  358.            (pattern "piarc.lzh.parta")
  359.            (files)
  360. )
  361.  
  362. ; Install the dctv.library for reading and writing dctv pix
  363. ; Also, get part B of the piarc.lzh file
  364. ;----------------------------------------------------------
  365. (set imp_src src_four)
  366. (askdisk
  367.     (prompt ("Please insert the %s diskette " imp_src))
  368.     (help "This diskette is required to install "
  369.           "dctv.library, and possibly the addendum "
  370.           "documentation, if you asked for it on disk.")
  371.     (dest imp_src)
  372. )
  373. (copyfiles (source (cat imp_src ":"))
  374.            (dest "ram:")
  375.            (pattern "dc.lzh")
  376.            (files)
  377. )
  378. (copyfiles (source (cat imp_src ":"))
  379.            (dest "ram:")
  380.            (pattern "piarc.lzh.partb")
  381.            (files)
  382. )
  383. (run ("c:join ram:piarc.lzh.parta ram:piarc.lzh.partb TO ram:piarc.lzh"))
  384. (run ("c:delete ram:piarc.lzh.part? QUIET"))
  385. (run ("ram:extract >con:0/50/640/100/extract -m e ram:dc ram:"))
  386. (copylib (source "ram:dctv.library")
  387.          (dest "libs:")
  388. )
  389. (delete "ram:dc.lzh")
  390. (delete "ram:dctv.library")
  391.  
  392.  
  393. ; If user wants the documents, install them
  394. ;------------------------------------------
  395. (if (= doc_install 1)
  396.     (
  397.         (if (not (exists doc_dir))
  398.             (makedir doc_dir (infos))
  399.         )
  400.         (copyfiles (source (cat imp_src ":"))
  401.                    (dest "ram:")
  402.                    (pattern "ia.lzh")
  403.                    (files)
  404.         )
  405.         (run ("ram:extract >con:0/50/640/100/extract -m e ram:ia %s/" doc_dir))
  406.         (delete "ram:ia.lzh")
  407.     )
  408. )
  409.  
  410. ; Now for the FUN part... get the PI modules installed
  411. ; Begin by backing up old macro file(s), if they exist
  412. ;-----------------------------------------------------
  413. (if (exists "s:Default.immcr.old")
  414.     (delete "s:Default.immcr.old"))
  415. (if (exists "s:Default.immcr")
  416.     (rename "s:Default.immcr" "s:Default.immcr.old"))
  417. ;---------------
  418. (if (exists "s:Default.iimcr.old")
  419.     (delete "s:Default.iimcr.old"))
  420. (if (exists "s:Default.iimcr")
  421.     (rename "s:Default.iimcr" "s:Default.iimcr.old"))
  422. ;---------------
  423. (if (exists "s:Default.ipmcr.old")
  424.     (delete "s:Default.ipmcr.old"))
  425. (if (exists "s:Default.ipmcr")
  426.     (rename "s:Default.ipmcr" "s:Default.ipmcr.old"))
  427. ;---------------
  428.  
  429. ; Old macros are backed up, ready for main PI install
  430. ; Now really extract the stuff
  431. ;----------------------------------------------------
  432. (run ("ram:extract >con:0/50/640/100/extract -m e ram:piarc ram:gbzyx/"))
  433. (delete "ram:piarc.lzh")
  434.  
  435. ; Archive is unpacked and ready to copy
  436. ; first, backup list.list if available
  437. ;--------------------------------------
  438. (if (exists "cmpi:list.list")
  439.     (
  440.         (if (exists "cmpi:list.list.old")
  441.             (delete "cmpi:list.list.old")
  442.         )
  443.         (rename "cmpi:list.list" "cmpi:list.list.old")
  444.         (message "Please note that during installation, your previous "
  445.                  "\"list.list\" file was located and renamed to "
  446.                  "\"list.list.old\". All of your aftermarket PI "
  447.                  "modules (if any) are still intact, but will not "
  448.                  "show up on PI lists untill the new list.list file "
  449.                  "has been appropriately modified."
  450.          (help   "This has been done so that you may refer to it if "
  451.                  "you had aftermarket PI modules declared in it. "
  452.                  "A new list.list file has been created as part of "
  453.                  "this install procedure - you should use this new "
  454.                  "list.list file instead of the old one (that will "
  455.                  "happen automatically) but if you DID have any "
  456.                  "aftermarket PI modules, such as Metadigm's ES300c "
  457.                  "scanner driver, you'll need to add the control "
  458.                  "line(s) for it (them) into the new list.list file. "
  459.                  "You would then use the old list.list file as a template "
  460.                  "to accomplish this.")
  461.         )
  462.     )
  463. )
  464.  
  465. ; move the "odd" files (not PI rexx or PI cmds)
  466. ;----------------------------------------------
  467. (copyfiles (source "ram:gbzyx") (dest "rexx:")
  468.            (pattern "(picmdpath|launch.rexx)") (files))
  469. (copyfiles (source "ram:gbzyx") (dest "s:")
  470.            (pattern "(default.??mcr)") (files))
  471. (copyfiles (source "ram:gbzyx") (dest "cmpi:")
  472.            (pattern "list.list") (files))
  473. (copyfiles (source "ram:gbzyx") (dest "rxpi:wipes")
  474.            (pattern "#?.rxwp") (files))
  475. (delete "ram:gbzyx/picmdpath")
  476. (delete "ram:gbzyx/list.list")
  477. (delete "ram:gbzyx/launch.rexx")
  478. (run "delete ram:gbzyx/Default.??mcr QUIET")
  479. (run "delete ram:gbzyx/#?.rxwp QUIET")
  480.  
  481. ; Next, copy all the PI ARexx scripts
  482. ;------------------------------------
  483. (copyfiles (source "ram:gbzyx") (dest "rxpi:")
  484.            (pattern "#?.rexx") (files))
  485. (run "delete ram:gbzyx/#?.rexx QUIET")
  486.  
  487. ; Next, copy all the PI Commands
  488. ;-------------------------------
  489. (copyfiles (source "ram:gbzyx") (dest "cmpi:")
  490.            (pattern "#?") (files))
  491.  
  492. ; Now, we have to decide if we can install the FPU PI modules
  493. ;------------------------------------------------------------
  494. (if (exists "CMPI:rdjpg") (delete "CMPI:rdjpg"))
  495. (if (exists "CMPI:wrjpg") (delete "CMPI:wrjpg"))
  496. (if (= float_install 0)
  497.     ((rename "CMPI:x_JPR030" "CMPI:rdjpg")  ; then
  498.      (rename "CMPI:x_JPW030" "CMPI:wrjpg"))
  499.     ((rename "CMPI:x_JPR000" "CMPI:rdjpg")  ; else
  500.      (rename "CMPI:x_JPW000" "CMPI:wrjpg"))
  501. )
  502.  
  503. ; clean up
  504. ;---------
  505. (run "delete CMPI:x_#? QUIET")
  506. (run "delete ram:gbzyx/#? QUIET")
  507. (delete "ram:gbzyx")
  508. (delete "ram:extract")
  509.  
  510. ; Add assignment to user's "user-startup" directory for new boot ops
  511. ; IF they were not already correctly done
  512. ;-------------------------------------------------------------------
  513. (if (= as_made 0)
  514.     (startup "Imagemaster"
  515.         (help "This operation adds lines to your user-startup file "
  516.               "which are harmless assignment statements to drawers "
  517.               "within the Imagemaster drawer, called \"RXPI:\" and "
  518.               "\"CMPI:\" each time you boot your Amiga. These assignments "
  519.               "are used to let Imagemasters Public Interface (PI) drivers know "
  520.               "where its data files reside. Unless you know that you have "
  521.               "another assignment with one of these names, it is extremely "
  522.               "unlikely that there would be any reason to NOT let this happen. "
  523.               "Note that if this is a reinstall, but it is the first time "
  524.               "you have installed using this installation procedure, you "
  525.               "SHOULD allow these assigns to be made, even if you had "
  526.               "assigns to RXPI and CMPI you created yourself. The PI "
  527.               "modules are now kept in a different location, so these new "
  528.               "assignments are necessary.")
  529.         (prompt "Is it o.k. to add two SAFE lines to your User-Startup "
  530.                 "file?")
  531.         (command ("assign RXPI: %s\n" rxpi_dir))
  532.         (command ("assign CMPI: %s" cmpi_dir))
  533.     )
  534. )
  535.  
  536. (exit)
  537.